<template>

  <div>
    <C2_0 name="Leroy" :age="age"/>
    <C2_1 name="Alex" age="18" @getData="getChildData"/>
    <C2_2 name="Alice" age="28"/>
    <div>
      {{ data }}
    </div>
  </div>

</template>

<script>

import Lesson2_2 from "@/components/Lesson2_2.vue";
import Lesson2_1 from "@/components/Lesson2_1.vue";

export default {
  provide() {
    return {
      msg: this.message,
    }
  },
  data() {
    return {
      age: 99,
      data: '',
      message: "我是统一下发的消息"
    }
  },
  components: {
    C2_1: Lesson2_1,
    C2_2: Lesson2_2
  },
  methods: {
    getChildData(data) {
      console.log(data)
      this.data = data
    }
  }
}

</script>
